home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0793july.archive
/
000048_crash!UNCA.EDU!JVANRIPER_Thu, 22 Jul 93 07:42:00 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
2KB
Received: by bkhouse.cts.com (V1.16/Amiga)
id AA00000; Thu, 22 Jul 93 07:42:00 PST
Received: from uncavx by crash.cts.com with smtp
(Smail3.1.28.1 #15) id m0oJ0Mz-00007MC; Thu, 22 Jul 93 06:07 PDT
Received: from UNCA.EDU by UNCA.EDU (PMDF V4.2-11 #3902) id
<01H0U5F9AFAU8WWJLH@UNCA.EDU>; Thu, 22 Jul 1993 09:04:22 EDT
Date: Thu, 22 Jul 1993 09:04:21 -0400 (EDT)
Message-id: <01H0U5F9AFAW8WWJLH@UNCA.EDU>
Organization: University of North Carolina at Asheville
X-VMS-To: IN%"amigae@bkhouse.cts.com"
MIME-version: 1.0
Content-type: TEXT/PLAIN; CHARSET=US-ASCII
Content-transfer-encoding: 7BIT
From: "Joseph E. Van_Riper III" <JVANRIPER@UNCA.EDU>
To: amigae@bkhouse.cts.com
Subject: Re: Help with datestamps
I think he typed something like:
----8<----8<----
MODULE 'dos/dos', 'dos/datetime'
PROC main()
DEF date : PTR TO datetime,
s[10] : ARRAY OF CHAR
date := New(SIZEOF datetime)
date.stamp := New(SIZEOF datestamp)
date.stamp := DateStamp(date.stamp) /*If doing it this way, try*/
date.strdate := s /* just 'DateStamp(date.stamp)'*/
DateToStr(date) /* without the assignment.*/
WriteF('date: \s\n',s)
ENDPROC
----8<----8<----
I tried something like this, too, and found it didn't work.
I think the reason why is E doesn't know that date.stamp is supposed to be of
object datestamp, so when you try to date.stamp:=DateStamp(date.stamp), it
fails. The following code has worked very well for me:
PROC whatever()
DEF dt:datetime
DateStamp(dt.stamp)
dt.format:=FORMAT_DOS /* set datetime options */
dt.flags:=0
dt.strday:=String(10)
dt.strdate:=String(10)
dt.strtime:=String(10)
DateToStr(dt) /* make into string */
/*whatever*/
ENDPROC
You can Dispose() of dt.strday/dt.strdate/dt.strtime if you want to keep from
losing room (say, in a program that will be calling on this routine fairly
regularly for a good while). For the program I'm working on, however, this was
adequate.
Hope it's helpful.
- Trey